import { postRequestJson } from '../api.js';

export default {
  async login({ userName, password }) {
    let url = '/api/login';
    const params = {
      username: userName,
      password
    }
    return new Promise((resolve, reject) => {
      postRequestJson(url, params).then(res => {
        resolve(res);
      });
    });
  },

  async getTokenMd({ tokenMd5 }) {
    let url = '/api/jsapi/gettokenmd';
    const params = {
      tokenMd5: tokenMd5,
    }
    return new Promise((resolve, reject) => {
      postRequestJson(url, params).then(res => {
        resolve(res);
      });
    });
  },

}
